import java.awt.event.ActionEvent;

public class DigitListener extends AnswerListenerAbstract {

    AnswerLabel answer;
    char digit;

    void setAnswer(AnswerLabel a) {
        answer = a;
    }

    AnswerLabel getAnswer() {
        return answer;
    }

    void setDigit(char c) {
        digit = c;
    }

    char getDigit() {
        return digit;
    }

    public DigitListener(AnswerLabel a, char c) {
        setAnswer(a);
        setDigit(c);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        getAnswer().append(getDigit());
    }
}
